package cn.edu.sgu.www.mhxysy.controller.chongwu_equipment;

import cn.edu.sgu.www.mhxysy.consts.CustomConstants;
import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.consts.MimeTypes;
import cn.edu.sgu.www.mhxysy.entity.chongwu_equipment.ChongwuTaozhuangSkillCategory;
import cn.edu.sgu.www.mhxysy.restful.JsonResult;
import cn.edu.sgu.www.mhxysy.service.chongwu_equipment.ChongwuTaozhaungSkillService;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Api(tags = "宠物套装技能管理")
@ApiSupport(author = CustomConstants.AUTHOR)
@Validated
@RestController
@RequestMapping(path = "/chongwu_taozhuang_skill", produces = MimeTypes.APPLICATION_JSON_CHARSET_UTF_8)
public class ChongwuTaozhuangSkillController {

	private final ChongwuTaozhaungSkillService chongwuTaozhaungSkillService;

	@Autowired
	public ChongwuTaozhuangSkillController(ChongwuTaozhaungSkillService chongwuTaozhaungSkillService) {
		this.chongwuTaozhaungSkillService = chongwuTaozhaungSkillService;
	}

	@ApiOperation("通过宠物ID查询宠物套装技能")
	@RequestMapping(value = "/selectByChongwuId", method = RequestMethod.GET)
	public JsonResult<ChongwuTaozhuangSkillCategory> selectByChongwuId(
			@ApiParam(name = "chongwuId", value = "宠物ID", required = true)
			@NotBlank(message = CustomMessages.CHONGWU_ID_NOT_NULL) String chongwuId) {
		ChongwuTaozhuangSkillCategory category = chongwuTaozhaungSkillService.selectByChongwuId(chongwuId);

		return JsonResult.success(null, category);
	}

}